/*!
\copyright  Copyright (c) 2022-2023 Qualcomm Technologies International, Ltd.
            All Rights Reserved.
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file
\brief   Header file for the LE Audio Client Audio Configurations.
*/

#ifndef LE_AUDIO_CLIENT_AUDIO_CONFIG_H_
#define LE_AUDIO_CLIENT_AUDIO_CONFIG_H_

#include "le_audio_client.h"

#ifdef INCLUDE_LE_AUDIO_UNICAST_SOURCE

/*! Maximum audio configurations supported at the same time. Since profiles only supports two
 *  configuration partially, keeping the maximum audio configuration as one for now. */
#define LE_AUDIO_CLIENT_MAX_AUDIO_CONFIGS_SUPPORTED    1

/*! \brief Audio Configuration Information */
typedef struct
{
    /*! Target latency */
    uint8           target_latency;

    /*! Stream capability for sink */
    uint32          sink_stream_capability;

    /*! Stream capability for source */
    uint32          source_stream_capability;

    /*! Preferred ISOAL framing */
    uint8           framing;

    /*! PHY from central */
    uint8           phy_ctop;

    /*! PHY from peripheral */
    uint8           phy_ptoc;

    /*! RTN from central to peripheral */
    uint8           rtn_ctop;

    /*! RTN from peripheral to central */
    uint8           rtn_ptoc;
}le_audio_client_audio_config_t;

#endif /* INCLUDE_LE_AUDIO_UNICAST_SOURCE */

#ifdef INCLUDE_LE_AUDIO_BROADCAST_SOURCE

/*! \brief Various broadcast audio configuration types */
typedef enum
{
    /*! Broadcast audio configuration type is not known or invalid */
    LE_AUDIO_CLIENT_BROADCAST_CONFIG_INVALID,

    /*! High quality broadcast audio configuration */
    LE_AUDIO_CLIENT_BROADCAST_CONFIG_TYPE_HQ,

    /*! Todo: Add more configurations */
}le_audio_client_broadcast_config_type_t;

/*! \brief Structure to hold audio configuration information for broadcast */
typedef struct
{
    /*! Configuration type to use for broadcast */
    le_audio_client_broadcast_config_type_t config_type;

    /*! Presentation delay to synchronize the presentation of multiple BISs in a BIG */
    uint32 presentation_delay;

    /*! Total number of sub groups(non-zero) in the broadcast group */
    uint8 num_sub_group;

    /*! Sub group related information */
    TmapClientBigSubGroup *sub_group_info;
}le_audio_client_audio_broadcast_config_t;

#endif /* INCLUDE_LE_AUDIO_BROADCAST_SOURCE */

/*! \brief Initialise the audio configuration for LE audio client */
void leAudioClient_AudioConfigInit(void);

#ifdef INCLUDE_LE_AUDIO_UNICAST_SOURCE
/*! \brief Return audio configuration for the specified audio context and codec type */
const le_audio_client_audio_config_t* leAudioClient_GetAudioConfig(CapClientContext audio_context, uint8 codec);

#endif /* INCLUDE_LE_AUDIO_UNICAST_SOURCE */

#ifdef INCLUDE_LE_AUDIO_BROADCAST_SOURCE

/*! \brief Set the broadcast audio configuration type to use */
void leAudioClient_SetBroadcastAudioConfigType(le_audio_client_broadcast_config_type_t config_type);

/*! \brief Returns the broadcast audio configuration for the curent configuration type  */
const le_audio_client_audio_broadcast_config_t* leAudioClient_GetBroadcastAudioConfig(void);

#endif /* INCLUDE_LE_AUDIO_BROADCAST_SOURCE */

#endif /* LE_AUDIO_CLIENT_AUDIO_CONFIG_H_ */

